package com.doctcloud.hisinfo.histable.domain.comm;

import com.doctcloud.common.core.annotation.Excel;
import com.doctcloud.common.core.annotation.TableDesc;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

import static com.doctcloud.common.core.utils.StringUtils.trim;

@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(of = {"itemClass","itemName"})
@ToString
@TableDesc("药品处方分类字典")
public class PriceItemNameDictDo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Excel(name = "收费类型")
    @NotBlank(message = "收费类型不得为空")
    private String itemClass;
    @Excel(name = "收费名称")
    @NotBlank(message = "")
    private String itemName;
    @Excel(name = "收费代码")
    @NotBlank(message = "")
    private String itemCode;
    @Excel(name = "正名标记")
    @NotNull(message = "正名标记不得为空")
    private Integer stdIndicator;
    @NotNull(message = "输入码")
    private String inputCode;
    @Data
    public static class primaryKey {
        private final String itemClass;
        private final String itemName;
        public primaryKey(String itemClass,String itemName) {
            this.itemClass = itemClass;
            this.itemName = itemName;
        }
    }

    public void setItemClass(String itemClass) {
        this.itemClass = trim(itemClass);
    }

    public void setItemName(String itemName) {
        this.itemName = trim(itemName);
    }

    public void setItemCode(String itemCode) {
        this.itemCode = trim(itemCode);
    }

    public void setInputCode(String inputCode) {
        this.inputCode = trim(inputCode);
    }
}
